﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace hometask_Flights_Class
{
    class Program
    {
        static void Main(string[] args)
        {
            //Flight flight = new Flight();
            List<Flight> flights = new List<Flight>();
            string choiceToInput = "n";

            do
            {
                Console.WriteLine("Let's add flight information!");
                Flight flight = new Flight();
                flight.FillFlightInfo();
                flights.Add(flight);
                Console.WriteLine("Add another flight? (y/n)");
                choiceToInput = Console.ReadLine();
            }
            while (choiceToInput == "y");

            foreach(var f in flights)
            {
                f.PrintFlightInfo();
            }
            Console.WriteLine("\nPress any key to continue. . .");
            Console.ReadKey();
            Console.Clear();
            Console.WriteLine("Enter a destiantion to see flights.");
            string userChoiceDestination = Console.ReadLine();
            foreach (var f in flights)
            {
                if (f.destination == userChoiceDestination)
                {
                    f.PrintFlightInfo();
                    Console.WriteLine();
                }
            }
            Console.ReadKey();
        }
    }
}
